<?php
/**
 * 各种确认书界面
 * @author Administrator
 *
 */
class affirmAction extends globalAction
{
	/**
	 * 支付确认书
	 * 显示支付的确认书,
	 * 每个员工只能查看自己的确认书，工作人员可以查看所有的
	 * 
	 */
	function zhifu()
	{
		$orderid=$_REQUEST["orderid"];//订单号
		$mr=D("orderform");
		global $SystemConest;

		//@todo: 以后再添加会员只能查看自己的订单，管理人员可以查看所有的.
		
		$sql="select * from ".$SystemConest[7]."orderform as a left join ".$SystemConest[7]."pay as b on a.orderform3=b.pay1 where a.orderform3='".$orderid."' order by a.orderform0 desc";
		$rs=$mr->query($sql);
		//获取是哪一条线路
		if($rs[0]["orderform1"]!="")
		{
			$tourmr=A("tour");
			
			$trs=$tourmr->getrsone("tour0=".$rs[0]["orderform1"]);
		    
		}
		

		$this->assign("tourrs",$trs);//所订的线路信息
		
		$this->assign("rs",$rs[0]);
		$this->display();
		
	}
	
	
/**
	 * 支付确认书
	 * 显示支付的确认书,
	 * 每个员工只能查看自己的确认书，工作人员可以查看所有的
	 * 
	 */
	function hotelzhifu()
	{
		$orderid=$_REQUEST["orderid"];//订单号
		$mr=D("Home/orderform");
		global $SystemConest;

		//@todo: 以后再添加会员只能查看自己的订单，管理人员可以查看所有的.
		
		$sql="select * from ".$SystemConest[7]."orderform as a left join ".$SystemConest[7]."pay as b on a.orderform3=b.pay1 where a.orderform3='".$orderid."' order by a.orderform0 desc";
		$rs=$mr->query($sql);
		//获取是哪一条线路
		if($rs[0]["orderform1"]!="")
		{
			$tourmr=A("hotel");
			
			$trs=$tourmr->getrsone("hotel0=".$rs[0]["orderform1"]);

		}
		
	
		$this->assign("hotelrs",$trs);//所订的线路信息
		
		$this->assign("rs",$rs[0]);
		$this->display();
		
	}
	
	
	
	/**
	 * 出团通知书界面
	 */
	function chutuantongzhi()
	{
		$orderid=$_REQUEST["orderid"];//订单号
		$showedit=$_REQUEST["showedit"];//是否显示html样式 值为ye时显示html样式
		$sendflag=$_REQUEST["sendflag"];//是否显示发送标识
		$mr=D("orderform");
		global $SystemConest;

		//@todo: 以后再添加会员只能查看自己的订单，管理人员可以查看所有的.
		
		$sql="select * from ".$SystemConest[7]."orderform as a left join ".$SystemConest[7]."pay as b on a.orderform3=b.pay1 where a.orderform3='".$orderid."' order by a.orderform0 desc";
		$rs=$mr->query($sql);
		//获取是哪一条线路
		if($rs[0]["orderform1"]!="")
		{
			$tourmr=A("tour");
			$trs=$tourmr->getrsone("tour0=".$rs[0]["orderform1"]);
		}
		
		//用数组格化化需要的信息
		$ac=array(
			"jiejisongji"=>getformcontent($rs[0]["orderform29"],"集合接送"),
			"chutuhao"=>getformcontent($rs[0]["orderform29"],"团号"),
			"yukuanzhifu"=>getformcontent($rs[0]["orderform29"],"余款支付信息"),
			"dangdilvyousang"=>getformcontent($rs[0]["orderform29"],"供应商"),
			"contactinfo"=>getformcontent($rs[0]["orderform29"],"梦之旅联系信息"),
		);
		
		$this->assign("tourrs",$trs);//所订的线路信息
		$this->assign("sendflag",$sendflag);
		$this->assign("ac",$ac);
		$this->assign("showedit",$showedit);
		$this->assign("rs",$rs[0]);
		$this->display();
	}
	
	/**
	 * 国内合同模板
	 */
	function guoleihetong()
	{
		$orderid=$_REQUEST["orderid"];
		$mr=D("orderform");
		global $SystemConest;
		$sql="select * from ".$SystemConest[7]."orderform as a left join ".$SystemConest[7]."pay as b on a.orderform3=b.pay1 where a.orderform3='".$orderid."' order by a.orderform0 desc";
		$rs=$mr->query($sql);
	if($rs[0]["orderform1"]!="")
		{
			$tourmr=A("tour");
			$trs=$tourmr->getrsone("tour0=".$rs[0]["orderform1"]);
		}
		
		//获取合同里的各项值
		$hetong=$rs[0]["orderform32"];
		$ac=array(
			"jiafangname"=>getformcontent($hetong,"jiafangname"),//甲方名称
			"Youraddress"=>getformcontent($hetong,"Youraddress"),//甲方地址
			"jiaemail"=>getformcontent($hetong,"jiaemail"),////甲方电子邮件
			"Yourtel"=>getformcontent($hetong,"Yourtel"),//甲方电话
			"YiafangName"=>getformcontent($hetong,"YiafangName"),//乙方名称
			"jinyunXuKeZheng"=>getformcontent($hetong,"jinyunXuKeZheng"),//许可证编号
			"jinyunhuanwei"=>getformcontent($hetong,"jinyunhuanwei"),//经营范围
			"Yitel"=>getformcontent($hetong,"Yitel"),//乙方电话
			"tuanno"=>getformcontent($hetong,"tuanno"),//团号
			"protname"=>getformcontent($hetong,"protname"),//旅游线路
			"cfsd"=>getformcontent($hetong,"cfsd"),//出发时间地址
			"JiaoTongJiBiaoZhun"=>getformcontent($hetong,"JiaoTongJiBiaoZhun"),//交通及标准
			"zylsd"=>getformcontent($hetong,"zylsd"),//行程
			"ycsbz"=>getformcontent($hetong,"ycsbz"),//用餐次数及标准
			"zxbz"=>getformcontent($hetong,"zxbz"),//住宿标准
			"gwanpai"=>getformcontent($hetong,"gwanpai"),//购物安排
			"ZhiFeiXiangMu"=>getformcontent($hetong,"ZhiFeiXiangMu"),//自费项目
			"daoyoufeiy"=>getformcontent($hetong,"daoyoufeiy"),//导游及费用
			"fyzfbf"=>getformcontent($hetong,"fyzfbf"),//旅游费用
			"zhifubanf"=>getformcontent($hetong,"zhifubanf"),//支付办法
			"qtyy"=>getformcontent($hetong,"qtyy"),//不成团时转旅行社
			"ZhuanBinTuanTravel"=>getformcontent($hetong,"ZhuanBinTuanTravel"),//转并团信息
			"DiJieTravel"=>getformcontent($hetong,"DiJieTravel"),//地接社信息
			"beizhu"=>getformcontent($hetong,"beizhu"),//备注
			"BaoXianGSLianXiRen"=>getformcontent($hetong,"BaoXianGSLianXiRen"),//保险公司联系人
			"LvYouFeiYongShuoMing1"=>getformcontent($hetong,"LvYouFeiYongShuoMing1"),//旅游交通费1
			"LvYouFeiYongShuoMing2"=>getformcontent($hetong,"LvYouFeiYongShuoMing2"),//旅游交通费2
			"QiTaFeiYong"=>getformcontent($hetong,"QiTaFeiYong"),//其它费用
			"xdwp"=>getformcontent($hetong,"xdwp"),//携带证件
			"SuangYueDing"=>getformcontent($hetong,"SuangYueDing"),//约定1
			"SuangYueDingYiZ"=>getformcontent($hetong,"SuangYueDingYiZ"),//约定2
			"cfrq"=>getformcontent($hetong,"cfrq"),//提前通知天数
			"other1"=>getformcontent($hetong,"other1"),//其它条款1
			"other2"=>getformcontent($hetong,"other2"),//
			"other3"=>getformcontent($hetong,"other3"),//
			"other4"=>getformcontent($hetong,"other4"),//
			"other5"=>getformcontent($hetong,"other5"),//
			"jiafangAllPersren"=>getformcontent($hetong,"jiafangAllPersren"),//甲方所有人员名单及证件
			"jiafangrenydb"=>getformcontent($hetong,"jiafangrenydb"),//甲方人员代表
			"yifangrenydb"=>getformcontent($hetong,"yifangrenydb"),//乙方人员代表
			"qanyuedate"=>getformcontent($hetong,"qanyuedate"),//签定日期
	
		);
		
		
		$this->assign("Login",$_SESSION["Login"]);
		$this->assign("rs",$rs[0]);
		$this->assign("ddr","hello");
		$this->assign("showedit",$_REQUEST["showedit"]);
		$this->assign("sendflag",$_REQUEST["sendflag"]);
		$this->assign("trs",$trs);
		$this->assign("ac",$ac);
		$this->display();
		
	}
	
	/**
	 * 出境合同模板
	 */
	function chujinghetong()
	{
		
		
	
		$orderid=$_REQUEST["orderid"];
		$mr=D("orderform");
		global $SystemConest;
		$sql="select * from ".$SystemConest[7]."orderform as a left join ".$SystemConest[7]."pay as b on a.orderform3=b.pay1 where a.orderform3='".$orderid."' order by a.orderform0 desc";
		$rs=$mr->query($sql);
		if($rs[0]["orderform1"]!="")
		{
			$tourmr=A("tour");
			$trs=$tourmr->getrsone("tour0=".$rs[0]["orderform1"]);
		}
		
		//获取合同里的各项值
		$hetong=$rs[0]["orderform32"];
		$ac=array(
			"hetongbianhao"=>getformcontent($hetong,"hetongbianhao"),//合同编号
			"jiafangName"=>getformcontent($hetong,"jiafangName"),//甲方名称
			"Youraddress"=>getformcontent($hetong,"Youraddress"),//住所或单位地址
			"Email_send"=>getformcontent($hetong,"Email_send"),//
			"Yourtel"=>getformcontent($hetong,"Yourtel"),//
			"YifangName"=>getformcontent($hetong,"YifangName"),//
			"YicompanyAddress"=>getformcontent($hetong,"YicompanyAddress"),//
			"jinyunhuanwei"=>getformcontent($hetong,"jinyunhuanwei"),//
			"jinyunXuKeZheng"=>getformcontent($hetong,"jinyunXuKeZheng"),//
			"Yitel"=>getformcontent($hetong,"Yitel"),//
			"tuanno"=>getformcontent($hetong,"tuanno"),//
			
			"CountryAndArea"=>getformcontent($hetong,"CountryAndArea"),//
			"chufaTimeSTuan"=>getformcontent($hetong,"chufaTimeSTuan"),//
			"JiaoTongJiBiaoZhun"=>getformcontent($hetong,"JiaoTongJiBiaoZhun"),//
			"zylsd"=>getformcontent($hetong,"zylsd"),//
			"ycsbz"=>getformcontent($hetong,"ycsbz"),//
			"zxbz"=>getformcontent($hetong,"zxbz"),//
			"gwanpai"=>getformcontent($hetong,"gwanpai"),//
			"ZhiFeiXiangMu"=>getformcontent($hetong,"ZhiFeiXiangMu"),//
			"daoyoufeiy"=>getformcontent($hetong,"daoyoufeiy"),//
			"fyzfbf"=>getformcontent($hetong,"fyzfbf"),//
			"LvYouFeiYongBaoHanXuan"=>getformcontent($hetong,"LvYouFeiYongBaoHanXuan"),//
			"jiaotongfeiyong"=>getformcontent($hetong,"jiaotongfeiyong"),//
			"youleifeiy"=>getformcontent($hetong,"youleifeiy"),//
			"jiedaifeiyong"=>getformcontent($hetong,"jiedaifeiyong"),//
			"chanyingzhushu"=>getformcontent($hetong,"chanyingzhushu"),//
			"lvyoufuwufei"=>getformcontent($hetong,"lvyoufuwufei"),//
			"qitafeiyong"=>getformcontent($hetong,"qitafeiyong"),//
			"zfbf"=>getformcontent($hetong,"zfbf"),//
			"JiaoNaFangSi_zt"=>getformcontent($hetong,"JiaoNaFangSi_zt"),//
			"JiaoNaFangSi_xyk"=>getformcontent($hetong,"JiaoNaFangSi_xyk"),//
			"JiaoNaFangSi_qita"=>getformcontent($hetong,"JiaoNaFangSi_qita"),//
			"JiaoNaFangSi_xj"=>getformcontent($hetong,"JiaoNaFangSi_xj"),//
		
		
		
		
		
			"zhuanbit"=>getformcontent($hetong,"zhuanbit"),//
			"bunenfatian"=>getformcontent($hetong,"bunenfatian"),//
			"ZhuanBinTuanTravel"=>getformcontent($hetong,"ZhuanBinTuanTravel"),//
			"DiJieTravel"=>getformcontent($hetong,"DiJieTravel"),//
			"beizhu"=>getformcontent($hetong,"beizhu"),//
			"BaoXianGSLianXiRen"=>getformcontent($hetong,"BaoXianGSLianXiRen"),//
			"LvYouFeiYongShuoMing1"=>getformcontent($hetong,"LvYouFeiYongShuoMing1"),//
			"LvYouFeiYongShuoMing2"=>getformcontent($hetong,"LvYouFeiYongShuoMing2"),//
			"QiTaFeiYong"=>getformcontent($hetong,"QiTaFeiYong"),//
			"xdwpchuy"=>getformcontent($hetong,"xdwpchuy"),//
			"SuangYueDing"=>getformcontent($hetong,"SuangYueDing"),//
			"SuangYueDingYiZ"=>getformcontent($hetong,"SuangYueDingYiZ"),//
			"cfrq"=>getformcontent($hetong,"cfrq"),//
			"other1"=>getformcontent($hetong,"other1"),//
			"other2"=>getformcontent($hetong,"other2"),//
			"other3"=>getformcontent($hetong,"other3"),//
			"other4"=>getformcontent($hetong,"other4"),//
			"other5"=>getformcontent($hetong,"other5"),//
			"jiafangAllPersren"=>getformcontent($hetong,"jiafangAllPersren"),//
			"jiafangdaibiao"=>getformcontent($hetong,"jiafangdaibiao"),//
			"jiafangshengfengzheng"=>getformcontent($hetong,"jiafangshengfengzheng"),//
			"jiafangtelfax"=>getformcontent($hetong,"jiafangtelfax"),//
			"jiafengemail"=>getformcontent($hetong,"jiafengemail"),//
			"y_name"=>getformcontent($hetong,"y_name"),//
			"y_tel"=>getformcontent($hetong,"y_tel"),//
			"y_addr"=>getformcontent($hetong,"y_addr"),//
			"y_email"=>getformcontent($hetong,"y_email"),//
			"y_date"=>getformcontent($hetong,"y_date"),//
		);
		
		
		$ac['jiaotongfeiyong']="1";
		
		$showedit=$_REQUEST["showedit"];
		$sendflag=$_REQUEST["sendflag"];
		$this->assign("Login",$_SESSION["Login"]);
		$this->assign("rs",$rs[0]);
		$this->assign("showedit",$_REQUEST["showedit"]);
		$this->assign("sendflag",$sendflag);
		$this->assign("trs",$trs);
		$this->assign("ac",$ac);
		$this->display();
		
	}
	
}


?>